<script setup>
//注册钩子函数
import {ref, onMounted,onBeforeMount} from "vue";

const count = ref(0)//计数
//挂载时执行
onMounted(()=>{
  console.log('执行onMounted...')
})
//在这个钩子函数中获取远程数据
onBeforeMount(()=>{
  console.log('执行onBeforeMount...')
  //模拟从远程获取数据：Axios
  count.value = 230
})
</script>

<template>
    <div>从远处获取到的计数:{{count}}</div>
</template>

<style scoped>

</style>